package com.vfa.test;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import android.content.Context;

public class Utility {
	public static void CopyDatabase(Context c, String dataName, String dataPath) throws IOException{
		InputStream myInput = c.getAssets().open(dataName);
		String outFileName = dataPath;
		OutputStream myOutput = new FileOutputStream(outFileName);
		byte[] buffer = new byte[1024];
		int length;
		while((length = myInput.read(buffer))>0){
			myOutput.write(buffer, 0, length);
		}
		myOutput.flush();
		myOutput.close();
		myInput.close();
	}

}
